<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<script type="text/javascript" src="js/jquery-3.2.1.min.js" ></script>
		<title></title>
	</head>
	<body>

	<form>
		<button id="submit" value="test">
        <script>
            $('#submit').click(function() {
                const json = [{"id": 1}, {"id": 2}];
                $.ajax({
                    type:"POST",
                    url:"/task/testTask",
                    contentType:"application/json",
                    data:JSON.stringify(json),
                });
            });
		</script>
	</form>

	</body>
</html>
